//登录模块
import request from "../utils/request";

/* 删除文章 */
export const deleteArticle = id => {
  return request({
    method: "delete",
    url: `/v1_0/mp/articles/${id}`,
  });
};

/* 新增文章 */
export const addArticle = data => {
  return request({
    method: "POST",
    url: "/v1_0/mp/articles",
    data,
  });
};

/* 修改文章 */
export const editArticle = data => {
  return request({
    method: "PUT",
    url: `/v1_0/mp/articles/${data.id}`,
    data,
  });
};
/* 获取文章详情 */
export const getArticleDetail = id => {
  return request({
    method: "GET",
    url: `/v1_0/mp/articles/${id}`,
  });
};
